Optimal. Leaf size=191 \[ -\frac {a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (2+n)}+\frac {a (B (1+n)+A (2+n)) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1+n}{2};\frac {3+n}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{1+n}}{d f (1+n) (2+n) \sqrt {\cos ^2(e+f x)}}+\frac {a (A+B) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {2+n}{2};\frac {4+n}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{2+n}}{d^2 f (2+n) \sqrt {\cos ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 191, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3047, 3102,
2827, 2722} \begin {gather*} \frac {a (A+B) \cos (e+f x) (d \sin (e+f x))^{n+2} \, _2F_1\left (\frac {1}{2},\frac {n+2}{2};\frac {n+4}{2};\sin ^2(e+f x)\right )}{d^2 f (n+2) \sqrt {\cos ^2(e+f x)}}+\frac {a (A (n+2)+B (n+1)) \cos (e+f x) (d \sin (e+f x))^{n+1} \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\sin ^2(e+f x)\right )}{d f (n+1) (n+2) \sqrt {\cos ^2(e+f x)}}-\frac {a B \cos (e+f x) (d \sin (e+f x))^{n+1}}{d f (n+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 2827
Rule 3047
Rule 3102
Rubi steps
\begin {align*} \int (d \sin (e+f x))^n (a+a \sin (e+f x)) (A+B \sin (e+f x)) \, dx &=\int (d \sin (e+f x))^n \left (a A+(a A+a B) \sin (e+f x)+a B \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (2+n)}+\frac {\int (d \sin (e+f x))^n (a d (B (1+n)+A (2+n))+a (A+B) d (2+n) \sin (e+f x)) \, dx}{d (2+n)}\\ &=-\frac {a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (2+n)}+\frac {(a (A+B)) \int (d \sin (e+f x))^{1+n} \, dx}{d}+\frac {(a (B (1+n)+A (2+n))) \int (d \sin (e+f x))^n \, dx}{2+n}\\ &=-\frac {a B \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (2+n)}+\frac {a (B (1+n)+A (2+n)) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1+n}{2};\frac {3+n}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{1+n}}{d f (1+n) (2+n) \sqrt {\cos ^2(e+f x)}}+\frac {a (A+B) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {2+n}{2};\frac {4+n}{2};\sin ^2(e+f x)\right ) (d \sin (e+f x))^{2+n}}{d^2 f (2+n) \sqrt {\cos ^2(e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 3.38, size = 392, normalized size = 2.05 \begin {gather*} -\frac {2^{-2-n} a e^{i f n x} \left (1-e^{2 i (e+f x)}\right )^{-n} \left (-i e^{-i (e+f x)} \left (-1+e^{2 i (e+f x)}\right )\right )^n \left (\frac {2 (A+B) e^{-i (e+f (1+n) x)} \, _2F_1\left (\frac {1}{2} (-1-n),-n;\frac {1-n}{2};e^{2 i (e+f x)}\right )}{1+n}-\frac {2 (A+B) e^{i (e-f (-1+n) x)} \, _2F_1\left (\frac {1-n}{2},-n;\frac {3-n}{2};e^{2 i (e+f x)}\right )}{-1+n}+i \left (\frac {B e^{-i (2 e+f (2+n) x)} \, _2F_1\left (-1-\frac {n}{2},-n;-\frac {n}{2};e^{2 i (e+f x)}\right )}{2+n}+\frac {e^{-i f n x} \left (B e^{2 i (e+f x)} n \, _2F_1\left (1-\frac {n}{2},-n;2-\frac {n}{2};e^{2 i (e+f x)}\right )-2 (2 A+B) (-2+n) \, _2F_1\left (-n,-\frac {n}{2};1-\frac {n}{2};e^{2 i (e+f x)}\right )\right )}{(-2+n) n}\right )\right ) \sin ^{-n}(e+f x) (d \sin (e+f x))^n (1+\sin (e+f x))}{f \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 1.20, size = 0, normalized size = 0.00 \[\int \left (d \sin \left (f x +e \right )\right )^{n} \left (a +a \sin \left (f x +e \right )\right ) \left (A +B \sin \left (f x +e \right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d\,\sin \left (e+f\,x\right )\right )}^n\,\left (A+B\,\sin \left (e+f\,x\right )\right )\,\left (a+a\,\sin \left (e+f\,x\right )\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________